﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.BizTalk.Bam.EventObservation;
using System.Data.SqlClient;

namespace Software41.Tracking.BAM.Adapters
{
    [Serializable]
    public class EventStreamAdapter : IEventStream
    {
        private EventStream innerEventStream;

        public EventStreamAdapter(EventStream stream)
        {
            this.innerEventStream = stream;
        }

        #region IEventStream Members

        void IEventStream.AddReference(string activityName, string activityInstance, string referenceType, string referenceName, string referenceData)
        {
            this.innerEventStream.AddReference(activityName, activityInstance, referenceType, referenceName, referenceData);
        }

        void IEventStream.AddReference(string activityName, string activityInstance, string referenceType, string referenceName, string referenceData, string longreferenceData)
        {
            this.innerEventStream.AddReference(activityName, activityInstance, referenceType, referenceName, referenceData, longreferenceData);
        }

        void IEventStream.AddRelatedActivity(string activityName, string activityInstance, string relatedActivityName, string relatedActivityInstance)
        {
            this.innerEventStream.AddRelatedActivity(activityName, activityInstance, relatedActivityName, relatedActivityInstance);
        }

        void IEventStream.BeginActivity(string activityName, string activityInstance)
        {
            this.innerEventStream.BeginActivity(activityName, activityInstance);
        }

        void IEventStream.Clear()
        {
            this.innerEventStream.Clear();
        }

        void IEventStream.EndActivity(string activityName, string activityInstance)
        {
            this.innerEventStream.EndActivity(activityName, activityInstance);
        }

        void IEventStream.Flush()
        {
            this.innerEventStream.Flush();
        }

        //void IEventStream.Flush(SqlConnection connection)
        //{
        //    throw new NotImplementedException();
        //}

        //void IEventStream.StoreCustomEvent(IPersistQueryable singleEvent)
        //{
        //    throw new NotImplementedException();
        //}

        void IEventStream.UpdateActivity(string activityName, string activityInstance, params object[] data)
        {
            this.innerEventStream.UpdateActivity(activityName, activityInstance, data);
        }


        #endregion
    }
}
